package me.yobol.greentable.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import me.yobol.greentable.bean.IngredientBean;

/**
 * @author Yobol
 *
 */
public interface IIngredientDAO {
	
	public int save(Connection ctn,IngredientBean ingredient) throws SQLException;
	
	public IngredientBean delete(Connection ctn,int ingredientId) throws SQLException;
	
	public void update(Connection ctn,int ingredientId,IngredientBean ingredient) throws SQLException;
	public void updateName(Connection ctn,int ingredientId,String name) throws SQLException;
	public void updateDescription(Connection ctn,int ingredientId,String description) throws SQLException;
	public void updateImg(Connection ctn,int ingredientId,String img) throws SQLException;
	public void updatePrice(Connection ctn,int ingredientId,float price) throws SQLException;
	public void updateDiscPrice(Connection ctn,int ingredientId,float discPrice) throws SQLException;
	public void updateScansCtr(Connection ctn,int ingredientId,int scansCtr) throws SQLException;
	public void updateFavouriteCtr(Connection ctn,int ingredientId,int favouriteCtr) throws SQLException;
	public void updateCommentCtr(Connection ctn,int ingredientId,int commentCtr) throws SQLException;
	public void updateFlag(Connection ctn,int ingredientId,String flag) throws SQLException;

	public IngredientBean get(Connection ctn,int ingredientId) throws SQLException;
	public List<IngredientBean> getAll(Connection ctn) throws SQLException;
//	public List<IngredientBean> getIgsFromN2M(Connection ctn,int n,int m) throws SQLException;
	public List<IngredientBean> getFirstNIgsByScans(Connection ctn,int n) throws SQLException;
	public List<IngredientBean> getByName(Connection ctn,String name) throws SQLException;
	public List<IngredientBean> getByTraderId(Connection ctn,int traderId) throws SQLException;
	public List<IngredientBean> getByNameAndTraderId(Connection ctn,String name,int traderId) throws SQLException;
}
